import 'vant/lib/index.css' // 引入 Vant 样式
import '@ny-ui/assets/m/css/common.css' // 引入 公共 样式

import Vant, { showToast } from 'vant'
import { registerComponents } from '@ny-ui' // 导入组件注册函数
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import i18n from '@/lang/m/index' // i18n
import * as utils from './utils/common/index'

import App from './App.vue'
import router from './router/m/index'

const app = createApp(App)
console.log(app.config, 1111)
// 忽略微信标签
app.config.compilerOptions.isCustomElement = (tag) => {
  return tag.startsWith('wx-open-launch-weapp')
}
// 注册所有组件
registerComponents(app)
app.config.globalProperties.$utils = utils
app.config.globalProperties.$msg = showToast

// 提供环境变量
app.provide('env', import.meta.env.VITE_ENV)

// 使用i18n
app.use(i18n)
app.use(createPinia())
app.use(Vant)
app.use(router)

app.mount('#app')
